#include "HydrofobicAntiStainDeviceController.h"
#include "Arduino.h"
HydrofobicAntiStainDeviceController::HydrofobicAntiStainDeviceController(ISoapHAL *HAL)
{
    this->HAL = HAL;
	length = 0;
}

TrayStatus HydrofobicAntiStainDeviceController::getTrayStatus(int index)
{
    return trays[index]->getTrayStatus();
}

void HydrofobicAntiStainDeviceController::flushTray(int index)
{
	if(index>=length) return;
    trays[index]->flush();
}

void HydrofobicAntiStainDeviceController::lockTrays()
{
	for(int count = 0;count<length;count++)
	{
		trays[count]->lock();
	}
}

void HydrofobicAntiStainDeviceController::unlockTrays()
{
    for(int count = 0;count<length;count++)
	{
		trays[count]->unlock();
	}
}


HydrofobicAntiStainCompartiment *HydrofobicAntiStainDeviceController::getTray(int index)
{
	if (index>=length) return NULL;
	return trays[index];
}

void HydrofobicAntiStainDeviceController::setTray(int index, HydrofobicAntiStainCompartiment *tray)
{
	if (index<length) return;
	trays[index] = tray;
	length++;
}